﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ZhanJiPanel : EventManager {
    public GameObject view;
    public Button close;
    public Text jv, zhanji, qiang;
    public override void InformationSetting()
    {
        BindingSource[0].GetComponent<Button>().onClick.AddListener(delegate
        {
            FaXianBtnClick();
            Des();
        });
        BindingSource[1].GetComponent<Button>().onClick.AddListener(delegate
        {
            MyClub();
            MessageManager.GetInstance().SendMsg768();
            Des();
        });
        BindingSource[2].GetComponent<Button>().onClick.AddListener(delegate
        {
            FirstPanel();
            Des();
        });
        BindingSource[4].GetComponent<Button>().onClick.AddListener(delegate
        {
            GetMe();
            Des();
        });
        close.onClick.AddListener(Close);
        jv.text = SaveDate.GetInstance().ZjAlllist.Jv.ToString();
        zhanji.text = SaveDate.GetInstance().ZjAlllist.Score.ToString();
        qiang.text = SaveDate.GetInstance().ZjAlllist.ZhuangNumber.ToString();
    }
    void Des()
    {
        Destroy(this.gameObject);
    }
    void FaXianBtnClick()
    {
        MessageManager.GetInstance().Send7140();
    }
    /// <summary>
    /// 展示俱乐部面板
    /// </summary>
    void ClubBtnClick()
    {
        //UIManager.ChangeUI(UIManager.PageState.RulePage, delegate (GameObject target)
        //{
        //    target.GetComponent<GameHallShowRulePage>().InformationSetting();
        //});
    }
    void MyClub()
    {
        UIManager.ChangeUI(UIManager.PageState.Club, (GameObject obj) =>
        {
            obj.GetComponent<MyClubbPanel>().InformationSetting();
        });
    }
    void GetMe()
    {
        UIManager.ChangeUI(UIManager.PageState.GetMe, (GameObject obj) =>
        {
            obj.GetComponent<GetMePanel>().InformationSetting();
        });
    }
    void FirstPanel()
    {
        UIManager.ChangeUI(UIManager.PageState.GameHallPage, (GameObject obj) =>
        {
            obj.GetComponent<GameHallPanel>().InformationSetting();
        });
    }
   public void SetView(int number) {
        view.transform.GetComponentsInChildren<OneP.InfinityScrollView.InfinityScrollView>()[0].Setup(number);
    }
    void Close() {
        Destroy(this.gameObject);
    }
}
